home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 August: Tool Chest / Apple_Developer_Group_August_1996_Tool_Chest.iso / Sample Code / Snippets / Devices / ModifyMouseAccl / CrsrDev.h next >
Encoding:
C/C++ Source or Header  |  1996-04-25  |  2.0 KB  |  73 lines  |  [TEXT/MPCC]

  1. /*
  2.     File:    CrsrDev.h
  3.     
  4.     By:    Rich Kubota
  5. */
  6.  
  7. #include <Types.h>
  8. #include <fixmath.h>
  9.  
  10. struct AcclPoint    {
  11.     Fixed        deviceSpeed;
  12.     Fixed        cursorSpeed;
  13. };
  14.  
  15. typedef struct AcclPoint AcclPoint;
  16.  
  17. struct AcclTable    {
  18.     Fixed        accel;
  19.     short        numAcclPoints;
  20.     AcclPoint    acclPoints[1];    
  21. };
  22.  
  23. typedef struct AcclTable AcclTable;
  24. typedef AcclTable *AcclTablePtr;
  25.  
  26. struct AcclRsrcType {
  27.     UInt32            acclClass;
  28.     short            numAcclTables;
  29.     AcclTable        acclTable[1];
  30. };
  31.  
  32. typedef struct AcclRsrcType AcclRsrcType;
  33. typedef AcclRsrcType *AcclRsrcPtr, **AcclRsrcHandle;
  34.  
  35. struct AccelPointRec {
  36.     Fixed    devSpeed;        // device speed
  37.     Fixed    slope;
  38.     Fixed    intercept;
  39. };
  40.  
  41. typedef struct AccelPointRec     AccelPointRec;
  42. typedef AccelPointRec            AccelPointArray[1];
  43. typedef AccelPointArray            *AccelPointArrPtr;
  44.  
  45. struct MyCursorDevice {
  46.     struct CursorDevice        *nextCursorDevice;            /* pointer to next record in linked list */
  47.     CursorData                *whichCursor;                /* pointer to data for target cursor */
  48.     long                    refCon;                        /* application-defined */
  49.     long                    unused;                        /* reserved for future */
  50.     OSType                    devID;                        /* device identifier (from ADB reg 1) */
  51.     Fixed                    resolution;                    /* units/inch (orig. from ADB reg 1) */
  52.     UInt8                    devClass;                    /* device class (from ADB reg 1) */
  53.     UInt8                    cntButtons;                    /* number of buttons (from ADB reg 1) */
  54.     UInt8                    filler1;                    /* reserved for future */
  55.     UInt8                    buttons;                    /* state of all buttons */
  56.     UInt8                    buttonOp[8];                /* action performed per button */
  57.     unsigned long            buttonTicks[8];                /* ticks when button last went up (for debounce) */
  58.     long                    buttonData[8];                /* data for the button operation */
  59.     unsigned long            doubleClickTime;            /* device-specific double click speed */
  60.     Fixed                    acceleration;                /* current acceleration */
  61.     AccelPointArrPtr        accelPointArrPtr;            /* fields used internally to CDM */
  62.     Fixed                    deltaX;                    
  63.     Fixed                    deltaY;                    
  64.     Fixed                    errorX;                    
  65.     Fixed                    errorY;    
  66.     Fixed                    denom;
  67.     Fixed                    spread;
  68.     UInt8                    newData;
  69.     UInt8                    filler2;            
  70. };
  71. typedef struct MyCursorDevice MyCursorDevice, *MyCursorDevicePtr;
  72.  
  73.